﻿using System.Globalization;
using System.Windows.Data;

namespace DimensionsHelper.Client.Converters;

public class ItalicToFontStyleConverter : IValueConverter
{
    public static ItalicToFontStyleConverter Instance => new();

    public object Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        if (value is true)
        {
            return FontStyles.Italic;
        }

        return FontStyles.Normal;
    }

    public object ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
    {
        return Binding.DoNothing;
    }
}
